package cn.anecansaitin.firecrafting.common.block;

import cn.anecansaitin.firecrafting.ModConstant;
import net.minecraft.tags.BlockTags;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraftforge.common.Tags;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;

public class ModBlocks {
    //创建方块注册器
    public static final DeferredRegister<Block> BLOCK = DeferredRegister.create(ForgeRegistries.BLOCKS, ModConstant.MOD_ID);
    //注册方块
    //火__________
    public static final RegistryObject<CustomFire> ENDER_FIRE = BLOCK.register("ender_fire", () -> new CustomFire(3f, (s) -> s.is(Tags.Blocks.OBSIDIAN)));
    public static final RegistryObject<CustomFire> HELL_FIRE = BLOCK.register("hell_fire", () -> new CustomFire(3f, (s) -> s.is(Blocks.MAGMA_BLOCK)));
    public static final RegistryObject<CustomFire> HEAVEN_FIRE = BLOCK.register("heaven_fire", () -> new CustomFire(3f, (s) -> s.is(BlockTags.SOUL_FIRE_BASE_BLOCKS)));
    public static final RegistryObject<CustomFire> THREE_MEIS_TRUE_FIRE = BLOCK.register("three_meis_true_fire", () -> new CustomFire(3f, (s) -> s.is(Blocks.BEACON)));
    public static final RegistryObject<CustomFire> MAGIC_FIRE = BLOCK.register("magic_fire", () -> new CustomFire(3f, (s) -> s.is(Blocks.GOLD_BLOCK)));
    public static final RegistryObject<CustomFire> DRAGON_BREATH_FIRE = BLOCK.register("dragon_breath_fire", () -> new CustomFire(3f, (s) -> s.is(Blocks.BEACON)));
    public static final RegistryObject<CustomFire> COMPANION_FIRE = BLOCK.register("companion_fire", () -> new CustomFire(0f, (s) -> s.is(Blocks.SLIME_BLOCK)));
    public static final RegistryObject<CustomFire> RAINBOW_FIRE = BLOCK.register("rainbow_fire", () -> new CustomFire(1f, (s) -> s.is(Blocks.AMETHYST_BLOCK)));
    //普通方块_____
    public static final RegistryObject<FireInterface> FIRE_INTERFACE = BLOCK.register("fire_interface", FireInterface::new);

    //注册器的调用
    public static void registry(IEventBus bus) {
        BLOCK.register(bus);
    }
}
